package com.wyiot.pet.model.dto;

import com.wyiot.core.api.PageQueryDTO;
import com.wyiot.core.api.ValidateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 查询订单列表or根据订/运单查询订单 数据传输对象
 *
 * @author yly
 * @since 2022年04月08日
 */
@Data
public class OrderQueryDTO extends PageQueryDTO {
    @NotNull(message = "用户id", groups = {ValidateGroup.First.class})
    private Long userId;
    /**
     * 订单号或运单号
     */
    @NotBlank(message = "请输入订单/运单号", groups = {ValidateGroup.First.class})
    private String number;
    /**
     * 查询状态
     */
    @Range(min = 0, max = 6, message = "请输入正确的状态",groups = {ValidateGroup.Second.class})
    private Integer state;

    /* 1:我寄的 0:我收的*/
    @NotNull(message = "用户id", groups = {ValidateGroup.Second.class})
    private boolean ifMyTake;

}